package com.assist.beans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import com.assist.model.Category;
import com.assist.service.ICategoryService;
import com.assist.service.impl.CategoryServiceImpl;

@ManagedBean(name = "categoryListBean")
@ApplicationScoped
public class CategoryListBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List<Category> categories;
	
	private Category selectedCategory;
	
	private ICategoryService categoryService;
	
	public CategoryListBean() {		
	
		categoryService = new CategoryServiceImpl();		
		categories = categoryService.getCategories();
		
	}

	public List<Category> getCategories() {
		return categories;
	}

	public void setCategories(List<Category> categories) {
		this.categories = categories;
	}

	public Category getSelectedCategory() {
		return selectedCategory;
	}

	public void setSelectedCategory(Category selectedCategory) {
		this.selectedCategory = selectedCategory;
	}
	
	
}
